<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <button @click="changeLogin('phone')">手机登录</button>
        <button @click="changeLogin('email')">邮箱登录</button>
        <template v-if="type==='email'">
            <label for="">邮箱登录</label>
            <input key="email" type="email" placeholder="请输入邮箱">
        </template>

        <template v-else="type==='email'">
            <label for="">手机登录</label>
            <input key="phone" type="text" placeholder="请输入手机号码">
        </template>
    </div>

    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                type:"email"
            },
            methods:{
                changeLogin(type){
                    this.type = type
                }
            }
        })
    </script>
</body>
</html>